package io.kiki.sba.registry.server.shared.util;

import io.kiki.sba.registry.common.model.Node;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;


public final class NodeUtils {
    private NodeUtils() {
    }

    public static <T extends Node> List<String> transferNodeToIpList(Collection<T> nodes) {
        List<String> result = new ArrayList<>(nodes.size());
        nodes.forEach(node -> result.add(node.getUrl().getIp()));
        return result;
    }
}
